package ExperimentTwo.Second_task;

import java.util.Locale;

/**
 * @author 北巷_东坡
 * @date 2022/10/16 20:26
 * @computer 10741
 */
public class Client_LDP {
    public static void main(String[] args) {
        LoadBalance_LDP206 balance1,balance2,balance3;
        balance1 = LoadBalance_LDP206.getLoadBalance();
        balance2 = LoadBalance_LDP206.getLoadBalance();
        balance3 = LoadBalance_LDP206.getLoadBalance();

        if (balance1 == balance2 && balance2 == balance3) {
            System.out.println("服务器负载均衡器具有唯一性！");
        }

        balance1.addServer("Server 1");
        balance2.addServer("Server 2");
        balance3.addServer("Server 3");

        for (int i = 0; i < 10; i++) {
            String server = balance1.getServer();
            System.out.println("分发请求至服务器：" + server);
        }
    }
}
